<?php
// function external(){
	// $n = 1;
	// return  function() use ($n) {
		// return $n;
	// };
// }

// var_dump( external(1,3));

// function getMoney() {
    // $rmb = 1;
    // $func = function() use ( $rmb ) {
        // echo $rmb;
    // };
    // $func();
// }

// getMoney();

function counter() {
$counter = 1;
return function() use(&$counter) {return $counter ++;};
}
$counter1 = counter();
$counter2 = counter();
echo "counter1: " . $counter1() . "<br />/n";
echo "counter1: " . $counter1() . "<br />/n";
echo "counter1: " . $counter1() . "<br />/n";
echo "counter1: " . $counter1() . "<br />/n";
echo "counter2: " . $counter2() . "<br />/n";
echo "counter2: " . $counter2() . "<br />/n";
echo "counter2: " . $counter2() . "<br />/n";
echo "counter2: " . $counter2() . "<br />/n";